package org.jsystem.swttestingclient;

import jsystem.framework.TestProperties;
import junit.framework.SystemTestCase;

public class RobotOperations extends SystemTestCase {
	protected SwtTestingClient swt = null;
	private String path = null;
	private String title = null;
	private String string = null;
	private String buttonText = null;
	private long time;
	public void setUp() throws Exception {
		swt = (SwtTestingClient)system.getSystemObject("swt");
	}
	/**
	 * Select menu item. The path is delimited using / char.
	 */
	@TestProperties(name="Robot: Select menu item: ${path}", paramsInclude={"path"})
	public void testSelectMenuItem() {
		swt.selectMenuItem(path);
	}
	
	/**
	 * Wait for shell showing.
	 */
	@TestProperties(name="Robot: Wait for shell: ${title}", paramsInclude={"title"})
	public void testWaitForShellShowing() {
		swt.waitForShellShowing(title);
	}
	
	/**
	 * Wait for shell showing.
	 */
	@TestProperties(name="Robot: Enter string: ${string}", paramsInclude={"string"})
	public void testEnterString() {
		swt.enterString(string);
	}
	/**
	 * Click button.
	 */
	@TestProperties(name="Robot: Click button: ${buttonText}", paramsInclude={"buttonText"})
	public void testClickButton() {
		swt.clickButton(buttonText );
	}
	/**
	 * Sleep.
	 */
	@TestProperties(name="Robot: Sleep: ${time}", paramsInclude={"time"})
	public void testSleep() {
		sleep(time);
	}

	public String getPath() {
		return path;
	}
	/**
	 * Set the path to use. For example: &File/&New	Alt+Shift+N/File
	 * @param path
	 */
	public void setPath(String path) {
		this.path = path;
	}
	public String getTitle() {
		return title;
	}
	
	/**
	 * Object title
	 * @param title
	 */
	public void setTitle(String title) {
		this.title = title;
	}
	public String getString() {
		return string;
	}
	/**
	 * The string to use
	 * @param string
	 */
	public void setString(String string) {
		this.string = string;
	}
	public String getButtonText() {
		return buttonText;
	}
	/**
	 * Button text
	 * @param buttonText
	 */
	public void setButtonText(String buttonText) {
		this.buttonText = buttonText;
	}
	public long getTime() {
		return time;
	}
	public void setTime(long time) {
		this.time = time;
	}

}
